package com.lds.erp.enums;

public enum ClientSourceEnum {
    /**
     * iPad客户端
     */
    IPAD("iPad", "iPad客户端"),
    /**
     * Android移动客户端
     */
    ANDROID("Android", "Android移动客户端"),
    /**
     * iPhone移动客户端
     */
    IPHONE("iPhone", "iPhone移动客户端"),
    /**
     * 其他,则视为PC端
     */
    PC("pc", "pc端"),;

    /**
     * 枚举值码
     */
    private final String code;

    /**
     * 枚举描述
     */
    private final String message;

    ClientSourceEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String code() {
        return code;
    }

    public String message() {
        return message;
    }

    public static ClientSourceEnum getByCode(String code) {
        for (ClientSourceEnum client : values()) {
            if (client.code().equals(code)) {
                return client;
            }
        }
        return null;
    }
}